﻿<?xml version="1.0" encoding="utf-8"?><Articles><Article><ArticlesID>935</ArticlesID><Title>K&amp;#237;ch hoạt Remote Connection cho SQL Server 2008</Title><Body>&amp;lt;p&amp;gt;Khi bạn kết nối đến SQL Server 2008 m&amp;amp;agrave; gặp phải c&amp;amp;aacute;c lỗi sau:&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;550&amp;quot; height=&amp;quot;169&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/12/1.png&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;amp;nbsp;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Cannot connect to SQL-Server-Instance-Name&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 28 &amp;amp;ndash; Server doesn&amp;amp;rsquo;t support requested protocol) (Microsoft SQL Server)&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;amp;nbsp;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;550&amp;quot; height=&amp;quot;169&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/12/2.png&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;amp;nbsp;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Cannot connect to SQL-Server-Instance-Name&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 &amp;amp;ndash; Error Locating Server/Instance Specified) (Microsoft SQL Server)&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;amp;nbsp;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;550&amp;quot; height=&amp;quot;134&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/12/3.png&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;amp;nbsp;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Cannot connect to SQL-Server-Instance-Name&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Login failed for user &amp;amp;lsquo;username&amp;amp;lsquo;. (Microsoft SQL Server, Error: 18456)&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Đ&amp;amp;oacute; ch&amp;amp;iacute;nh l&amp;amp;agrave; bạn chưa k&amp;amp;iacute;ch hoạt Remote Connection cho SQL Server. Để k&amp;amp;iacute;ch hoạt, bạn l&amp;amp;agrave;m theo c&amp;amp;aacute;c bước sau:&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;1. H&amp;amp;atilde;y bật SQL Server Browser Service l&amp;amp;ecirc;n nếu bạn chưa bật. SQL Server Browser sẽ &amp;amp;quot;lắng nghe&amp;amp;quot; c&amp;amp;aacute;c incoming request từ Client.&amp;lt;br /&amp;gt;
2. H&amp;amp;atilde;y Enable TCP/IP Protocol cho SQL Server 2008 để chấp nhận Remote Connection.&amp;lt;br /&amp;gt;
3. Thay đổi Server Authentication th&amp;amp;agrave;nh SQL Server and Windows Authentication, bởi mặc định SQL Server 2008 chỉ cho ph&amp;amp;eacute;p bạn để ở chế độ Windows Authentication trong khi đ&amp;amp;oacute; nếu bạn muốn d&amp;amp;ugrave;ng Remote Connection th&amp;amp;igrave; bạn phải để l&amp;amp;agrave; SQL Server Authentication.&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;B1: Mở SQL Server Config Manager: Start --&amp;amp;gt; Program --&amp;amp;gt; Microsoft SQL Server 2008 --&amp;amp;gt; Configuration Tools --&amp;amp;gt; SQL Server Configuration Manager&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;578&amp;quot; height=&amp;quot;264&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/12/4.png&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;B2: Tr&amp;amp;ecirc;n&amp;amp;nbsp;SQL Server Configuration Manager chọn SQL Server Services --&amp;amp;gt; Chọn SQL Server Browser &amp;amp;amp; Start n&amp;amp;oacute; nếu bạn đang Stop c&amp;amp;ograve;n kh&amp;amp;ocirc;ng h&amp;amp;atilde;y l&amp;amp;agrave;m tiếp B3&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;558&amp;quot; height=&amp;quot;379&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/12/5.png&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;B3: Click chuột đ&amp;amp;uacute;p v&amp;amp;agrave;o SQL Server Browser để xem Properties chọn account để Start SQL Server Browser Service ở đ&amp;amp;acirc;y t&amp;amp;ocirc;i để l&amp;amp;agrave; Local Service account.&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;395&amp;quot; height=&amp;quot;442&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/12/6.png&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;B4: Bạn chuyển tiếp qua Tab Service thay đổi Start Mode l&amp;amp;agrave; Automatic, sau đ&amp;amp;oacute; Click OK để ho&amp;amp;agrave;n tất&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;395&amp;quot; height=&amp;quot;442&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/12/7.png&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;B5: B&amp;amp;ecirc;n Panel b&amp;amp;ecirc;n tr&amp;amp;aacute;i, Expand SQL Server Network Configuration --&amp;amp;gt; chọn Protocols for SQLEXPRESS bạn c&amp;amp;oacute; thể thấy ngay l&amp;amp;agrave; Protocol TCP/IP đang bị Disabled&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;592&amp;quot; height=&amp;quot;424&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/12/9.png&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;B6: Click chuột phải chọn Enable&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;558&amp;quot; height=&amp;quot;399&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/12/10.png&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;B7: Bạn phải Restart SQL Sevices để thay đổi c&amp;amp;oacute; hiệu lực.&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;563&amp;quot; height=&amp;quot;117&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/12/11.png&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;558&amp;quot; height=&amp;quot;399&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/12/12.png&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;B8: Mở SQL Server Management Studio v&amp;amp;agrave; connect v&amp;amp;agrave;o SQL Server&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;575&amp;quot; height=&amp;quot;443&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/12/13.png&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;B9: Click chuột phải v&amp;amp;agrave;o SQL Server Instance v&amp;amp;agrave; chọn Properties&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;575&amp;quot; height=&amp;quot;443&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/12/14.png&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;B10: Chọn Security --&amp;amp;gt; Chọn SQL Server and Windows Authentication mode --&amp;amp;gt; OK&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;549&amp;quot; height=&amp;quot;493&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/12/15.png&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;B11: Bạn nhận được y&amp;amp;ecirc;u cầu phải Restart SQL Server&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;556&amp;quot; height=&amp;quot;119&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/12/16.png&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;B12: Click chuột phải v&amp;amp;agrave;o SQL Server Instance --&amp;amp;gt; Chọn Restart&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;img width=&amp;quot;567&amp;quot; height=&amp;quot;437&amp;quot; src=&amp;quot;http://dev.meotom.net/Uploads/admin/2010/6/12/17.png&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;B13: Bạn đ&amp;amp;atilde; cấu h&amp;amp;igrave;nh cho SQL Server 2008 kết nối từ xa th&amp;amp;agrave;nh c&amp;amp;ocirc;ng.&amp;lt;/p&amp;gt;
&amp;lt;p style=&amp;quot;text-align: right;&amp;quot;&amp;gt;&amp;lt;em&amp;gt;Dịch từ: linhlom.com&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;amp;nbsp;&amp;lt;/p&amp;gt;</Body><CommentEnabled>True</CommentEnabled><ViewCount>0</ViewCount><ReleaseDate>6/12/2010 2:15:25 AM</ReleaseDate><TotalComment>0</TotalComment><IsMedia>False</IsMedia><IsPicture>True</IsPicture><IsVote>True</IsVote><ArticlePassword /><PostVisible>0</PostVisible><ArticlePath>/2010/6/12/Kich-hoat-Remote-Connection-cho-SQL-Server-2008-3A7</ArticlePath><Approved>True</Approved><ImagePath /><CategoryId>23</CategoryId><ArrayCatID>23|0</ArrayCatID></Article></Articles>